package com.qut.graduate.busrtquery.greendao.bean;

import com.qut.graduate.busrtquery.BRTQConstant;
import com.qut.graduate.busrtquery.bean.BusInfoLineQuery;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

/**
 * 数据库线路查询历史表和收藏表的实体类
 * {"rid":"1","name":"1路","type":"gj","line":"四方-湖北路"},
 * {"rid":"10","name":"10路","type":"gj","line":"板桥坊-李村公园"}
 */
@Entity
public class BusLine {
    @Id(autoincrement = true)
    private Long id;
    private String rid = "";
    private String name = "";
    private String type = "";
    private String line = "";
    private String time = "";

    @Override
    public String toString() {
        return "BusLine{" +
                "id=" + id +
                ", rid='" + rid + '\'' +
                ", name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", line='" + line + '\'' +
                ", time='" + time + '\'' +
                '}' + '\n';
    }

    public BusLine(BusInfoLineQuery busInfoLineQuery) {
        this.rid = busInfoLineQuery.getRid();
        this.name =  busInfoLineQuery.getName();
        this.type =  busInfoLineQuery.getType();
        this.line =  busInfoLineQuery.getLine();
        String format = BRTQConstant.timeFormat.format(System.currentTimeMillis());
        this.time = format;
    }

    public BusLine(BusLineCollect busLineCollect) {
        this.rid = busLineCollect.getRid();
        this.name =  busLineCollect.getName();
        this.type =  busLineCollect.getType();
        this.line =  busLineCollect.getLine();
        String format = BRTQConstant.timeFormat.format(System.currentTimeMillis());
        this.time = format;
    }

    @Generated(hash = 1096474301)
    public BusLine(Long id, String rid, String name, String type, String line,
                   String time) {
        this.id = id;
        this.rid = rid;
        this.name = name;
        this.type = type;
        this.line = line;
        this.time = time;
    }

    @Generated(hash = 1871503588)
    public BusLine() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRid() {
        return this.rid;
    }

    public void setRid(String rid) {
        this.rid = rid;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getLine() {
        return this.line;
    }

    public void setLine(String line) {
        this.line = line;
    }

    public String getTime() {
        return this.time;
    }

    public void setTime(String time) {
        this.time = time;
    }

}
